今天是30天程式語言研究的第二十五天,由於最近寫unix語言的東西用到很多,所以做了很多筆記,就想說也分享給大家。
筆記:
cp:
i=重複時問是否覆蓋     p=連權限和修改時間都複製     r=複製目錄
a=dr
cp name1 name2        複製name1名為name2
cat:
cat name          顯示檔案內容
cat -b name     列出行號, 空行不標行號
cat -n name     列出行號, 空行有標行號
cat > test.txt << eof     當輸入到關鍵字eof中斷     可以直接修改test.txt檔
cat > test.txt                 (一般) 打甚麼傳甚麼進test.txt直到ctrl d
more:
more name          顯示檔案內容
more -p name     清空頁面再顯示內容
clear:
clear     清空頁面
cd:
cd     切回主目錄
cd  home/user/dir/..		
cd -     回到前一個所在目錄並顯示位置
cd ..    回到上一層目錄
chmod:
更改檔案權限
chmod     *** file     更改file的權限
*** ->u(user)g(group)o(other)
r=4, w=2, x=1
rwx=4+2+1=7     r-x=4+1=5     rw-=4+2=6
ex.chmod 777 user         把user的所有權限開啟
chmod a=rwx user     開啟user的使用者所有權限
chmod u=w user       把user使用者所有權轉成-w-